package com.pj.ca.service;

import java.security.PrivateKey;
import java.security.PublicKey;

/**
 * 描述：非对称签名,验签
 *
 * @author pengjun
 * @date 2021/11/3 10:53
 */
public interface AsymmetricalSignature {

    /**
     * 签名
     * @param data
     * @param privateKey
     * @param signAlgorithm
     * @return
     * @throws Exception
     */
    byte[]  sign(byte[] data, PrivateKey privateKey, String signAlgorithm) throws Exception;

    /**
     * 验签
     * @param signData
     * @param content
     * @param publicKey
     * @param signAlgorithm
     * @return
     * @throws Exception
     */
    boolean verifySign(byte[] signData, byte[] content, PublicKey publicKey, String signAlgorithm) throws Exception;
}
